<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入easyui的样式 -->
<link rel="stylesheet"  type="text/css" href="${pageContext.request.contextPath}/themes/default/easyui.css">
<link rel="stylesheet"  type="text/css" href="${pageContext.request.contextPath}/themes/icon.css">
<!-- js文件 -->
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
//页面加载时发送请求
$(function(){
	$('#psg').datagrid({
		url:"findJobRecord",
		queryParams: {			
			uid:"${user.uid}",
		}
	});
});

$(function(){
	//更改底部工具栏 getPager返回页面对象
	var pager = $('#psg').datagrid('getPager');	
	  pager.pagination({
		pageList: [10,20,30]
	});
})
//根据状态查询作业记录
$(function(){
	$("#ok").click(function(){
		var jsid =$("#JobState").combobox('getValue');
		var uid="${user.uid}"
	  	$.ajax({
	  		type:"post",
	  		url:"findStateJob",
	  		data:{"jsid":jsid,"uid":uid},
		    	dataType:"json",
		    	success:function(data){
		    		$("#psg").datagrid('loadData',data);		    	
		    	}   		
	  	  })
	})

})
</script>
<body>

	 <table id="psg" title="作业信息查询" class="easyui-datagrid" method="post"
            toolbar="#toolbar" pagination="true" fit="true"  
            striped="true"  pageSize="10"
            rownumbers="true" fitColumns="true" border="false">         
        <thead>
            <tr>  
            	<th field="jrid" hidden="true" >作业记录编号</th>               
                <th field="jname" width="50" resizable="false">作业名字</th> 
                <th field="beginTime" width="50" resizable="false">布置作业时间</th>
                <th field="endTime" width="50" resizable="false">完成作业时间</th>   
                <th field="name" width="50" resizable="false">名字</th>
                <th field="jsname" width="50" resizable="false">作业状态 </th>
                <th field="answer" width="50" resizable="false">学生答案 </th>
                <th field="grade" width="50" resizable="false">作业成绩</th>                  
            </tr>
        </thead>
    </table> 
    <div id="toolbar">
        <input id="JobState" class="easyui-combobox" name="JobState" style="width:90px;"
    			data-options="editable:false,valueField:'jsid',textField:'jsname'
    			,url:'findState'" required="required" missingMessage="请选择作业完成状态"/>    
		<a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok"  style="width:90px;" id="ok" >查询</a>
    </div>
</body>
</html>